package week03;

import java.util.Scanner;

public class Rectangle {
	private int width;
	private int length;
	
	public Rectangle(int width,int length) {
		this.width=width;
		this.length=length;
	}
	public int getWidth() {
		return width;
	}
	public void setWidth(int width) {
		this.width = width;
	}
	public int getLength() {
		return length;
	}
	public void setLength(int length) {
		this.length = length;
	}
	public static  int getPerimeter(int width,int length)
	{
		return (width+length)*2;
	}
	public int getArea(int width,int length)
	{
		return width*length;
	}
	
	public String toString() {
		return "Rectangle [width=" + width + ", length=" + length + "]";
	}
	
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		Rectangle[] rectangle=new Rectangle[2];
		int c=0;
		for (int i = 0; i < rectangle.length; i++) {
			Rectangle rectangle1=new Rectangle(in.nextInt(),in.nextInt());
			rectangle[i]=rectangle1;
		    c+=getPerimeter(rectangle[i].width,rectangle[i].length);
		 }
		System.out.println(c);
	}
	
	
}
